// Angular2
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode }      from '@angular/core';
import { AppModule } from './app.module';

// call to enable the production mode
if (process.env.ENV === 'production') {
  enableProdMode();
  // disableLogger();
}

// function disableLogger() {
//   console.log = () => {};
//   console.debug = () => {};
//   console.info = () => {};
//   // console.warn = () => {};
//   // console.error = () => {};
// }

// Angular 2 bootstrap
function main() {
    platformBrowserDynamic().bootstrapModule(AppModule);
}

if (document.readyState === 'complete') {
  main();
} else {
  document.addEventListener('DOMContentLoaded', main);
}

export default main;